//
//  main.cpp
//  PointCallbackFunction
//
//  Created by huge on 2021/8/23.
//  Copyright © 2021 huge. All rights reserved.
//

#include <iostream>

int multiplicationFunction(int val){
    
    std::cout << "call multiplication \n";
    val = val*2;
    return val;
}

int testCallbackFunction(int val,int(*pFunc)(int)){

    std::cout << "called testCallbackFunction \n";
    int result = 0;
    
    result = pFunc(val);
    
    return result;
}

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, multiplication!\n";
    
//    std::cout << "the result: " << multiplicationFunction(1)<< "\n";
    std::cout << "the result: " << testCallbackFunction(100, multiplicationFunction) << "\n";
    
    return 0;
}
